﻿module CodeCamp01.SpeakerRate
{
  import CodeCamp01.BasicTypes;
  import CodeCamp01.Events;
  import CodeCamp01.Contents;

  // types
    
  type SpeakerRateEvent
  {
    Id : Integer32 => AutoNumber();
    EventId : Event where value in Events;
    EventUrl : Text256;
  }
    
  type SpeakerRateSpeaker
  {
    Id : Integer32 => AutoNumber();
    PresenterId : Presenter where value in Presenters;
    SpeakerUrl : Text256;
  }
    
  type SpeakerRateTalk
  {
    Id : Integer32 => AutoNumber();
    SessionId : Session where value in Sessions;
    TalkUrl : Text256;
  }

  // extents
    
  SpeakerRateEvents : { SpeakerRateEvent* } where
    identity Id,
    unique EventId,
    unique EventUrl;

  SpeakerRateSpeakers : { SpeakerRateSpeaker* } where
    identity Id,
    unique PresenterId,
    unique SpeakerUrl;
    
  SpeakerRateTalks : { SpeakerRateTalk* } where
    identity Id,
    unique SessionId,
    unique TalkUrl;
}
